#!/usr/bin/python
# -*- coding: utf-8 -*-
# $Id$

# mpcheckup
# Copyright 2008, 2009 Grigoriy Kuznetsov (gkuznets@yandex.ru)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import sys

from PyQt4 import QtGui
from firstwindow import *
from gui.mainwindow import *
import logging
from checkup import Checkup
  
def runGUI():
    app = QtGui.QApplication([])
    startup_dialog = FirstWindow()
    if startup_dialog.exec_() == QtGui.QDialog.Accepted:
        checkup = Checkup.instance()
        checkup.problems_count = startup_dialog.problems_count()
        #self.checkups_count = startup_dialog.checkups_count()
        log_file_name = startup_dialog.log_file_name()
      
        logging.basicConfig(level=logging.INFO,
                            format="%(asctime)s %(message)s",
                            datefmt="%a, %d %b %Y %H:%M:%S",
                            filename=log_file_name,
                            filemode="w")
      
        main_window = MainWindow(checkup)
        main_window.show()
        app.exec_()

#try:
runGUI()
#except:
    
